import logging,yagmail,HTMLTestRunner

class Tools():
    def send_mail(self):
        mail = yagmail.SMTP(user='3047217905@qq.com',password='wsmqyonwzaxqdcgj',host='smtp.qq.com',port='465')
        mail.send(to='3047217905@qq.com',subject='酒仙自动化测试',contents=['jiuxian.log','jiuxian.html'])
        mail.close()

    def report(self):
        report = HTMLTestRunner.HTMLTestRunner(open('./jiuxian.html','wb'),
                                               title='酒仙报告',
                                               description='一条核心业务')
        return report

    def Log(self):
        log = logging.basicConfig(level=logging.DEBUG,filemode='a+',
                                  format='%(levelname)s-%(filename)s-%(asctime)s-%(message)s-%(lineno)d',
                                  filename='./jiuxian.log')
        return log